<?php
namespace Application\Api\Controller;

class Download extends Base
{

    private function getService()
    {
        return $this->get(SERVICE_DOWNLOAD);
    }

    /*
        /Api/Download/getListForDocument
    */
    public function getListForDocumentAction()
    {
        $service = $this->getService();
        $data = $service->getList('golang', 1, 100);
        foreach($data['list'] as $k => $v){
            $v->name = basename($v->dry_url);
            $data['list'][$k] = $v;
        }
        $this->sendSuccess(['list' => $data['list']]);
    }

}